package com.gomore.opple.module.main.shoppingcar;

import com.gomore.opple.BasePresenter;
import com.gomore.opple.BaseView;
import com.gomore.opple.rest.employee.LoginResult;
import com.gomore.opple.rest.shopcart.DeleteCartRequest;
import com.gomore.opple.web.cgform.consumer.entity.TOConsumerEntity;
import com.gomore.opple.web.cgform.shopcart.entity.TOShopcartEntity;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * Created by asus on 2016/12/27.
 */
public interface ShoppingCarContract {

    interface View extends BaseView<Presenter> {
        /**
         * 显示进度条
         */
        void showProgressDialog();

        /**
         * 隐藏进度条
         */
        void hideProgressDialog();

        /**
         * 展示消息
         *
         * @param msg 消息
         */
        void showMessage(String msg);

        /**
         * 展示消息
         *
         * @param msgId 消息id
         */
        void showMessage(int msgId);

        /**
         * 加载完毕
         */
        void showLoadMoreCompleted();

        /**
         * 刷新完毕
         */
        void showRefreshCompleted();

        /**
         * 展示内容
         */
        void showContentView();

        /**
         * 展示合计
         *
         * @param bigDecimal
         */
        void showTotal(BigDecimal bigDecimal, int size, boolean clearDiscountEditText);

        /**
         * 全选
         */
        void selectAllView();

        /**
         * 商品数量
         *
         * @param toShopcartEntityLists
         * @return
         */
        int getGoodNumber(List<TOShopcartEntity> toShopcartEntityLists);

    }

    interface Presenter extends BasePresenter {
        /**
         * 准备初始化数据
         */
        void prepareInitData();

        /**
         * 查询购物车
         *
         * @param consumerId
         */
        void queryShoppingCar(String consumerId);

        /**
         * 获取购物车数据
         */
        List<TOShopcartEntity> getShoppingCarData();

        /**
         * 获取当前客户
         *
         * @return
         */
        TOConsumerEntity getConsumer();

        /**
         * 获取导购
         *
         * @return
         */
        LoginResult getUser();

        /**
         * 合计
         *
         * @param shoppingCars
         * @param isSelected
         */
        void getTotal(List<TOShopcartEntity> shoppingCars, HashMap<Integer, Boolean> isSelected);


        /**
         * 修改成交价
         */
        void updateCostPrice(String cartId, String costPrice, String goodsId, String goodsNum, boolean isReflashShoppingCar);

        /**
         * 删除购物车
         *
         * @param goodIds
         */
        void deleteShoppingCar(List<String> goodIds);

    }
}
